package com.mashibing.disruptor;

import com.lmax.disruptor.EventHandler;

/**
 *  Disruptor使用步骤第三步
 *  定义EventHandler(消费者），处理容器中的元素
 * 消息的消费者
 * @author: Yuanzt
 * @Date: 2021/4/7
 */
public class LongEventHandler implements EventHandler<LongEvent> {

    public static long count = 0;

    @Override
    public void onEvent(LongEvent event,long sequence, boolean endOfBatch){
        count++;
        System.out.println("[" + Thread.currentThread().getName() + "]" + event + " 序号： " + sequence);
    }
}
